<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>请假记录</h2>
    </div>
    <div class="clearfix">
        <div class="col-xs-10">
            <a class="btn btn-success" href="{:U('addrecord')}">新增</a>
            <button class="btn ajax-post btn-primary" url="{:U('setStatus',array('method'=>'resume','model'=>'core_leave'))}"
                    target-form="ids">通过
            </button>
            <button class="btn ajax-post btn-warning" url="{:U('setStatus',array('method'=>'forbid','model'=>'core_leave'))}"
                    target-form="ids">不通过
            </button>
            <div class="input-group" style="display: inline-block;">
                <input type="text" name="keyword" class="search-input form-control" value="" placeholder="请输入请假原因" style="width: 80%;">
        <br/>
        <br/>
                <input type="submit" name="anniu" value="搜索">
            </div>
            </form>
        </div>
    </div>
 
    <div class="data-table with-padding">
        <table class="table table-bordered table-striped ">
            <thead>
            <tr>
                <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                <th class="">id</th>
                <th class="">请假类型</th>
                <th class="">请假日期</th>
                <th class="">请假天数</th>
                <th class="">请假原因</th>
                <th class="">创建时间</th>
                <th class="">更新时间</th>
                <th class="">审核时间</th>
                <th class="">状态</th>
                <th class="">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.lname}</td>
                        <td>{$vo.leave_date|time_format}</td>
                        <td>{$vo.days}</td>
                        <td>{$vo.reason}</td>
                        <td>
                        <if condition="$vo[create_time] neq 0 ">
                            {$vo.create_time|time_format}
                        <else/>
                            暂无
                        </if>
                        </td>
                        <td>
                        <if condition="$vo[update_time] neq 0 ">
                            {$vo.update_time|time_format}
                        <else/>
                            暂无
                        </if>
                        </td>
                        <td>
                        <if condition="$vo[check_time] neq 0 ">
                            {$vo.check_time|time_format}
                        <else/>
                            暂无
                        </if>
                        </td>
                        <td>
                            <if condition="$vo.status eq 1">
                            <span style="color:green;">通过</span>
                            <else/>
                            <span style="color:red;">不通过</span>
                            </if>
                        </td>
                        <td>
                            <a class="status status_1" href="{:U('editimpl',array('id'=>$vo['id']))}">编辑</a>
                            <if condition="$vo.status neq 1">
                     
                            <a class="status status_2 ajax-get" onclick="javascript:if(confirm('确定通过吗?')){return true} else{return false;}"href="{:U('pass',array('method'=>'pass',id=>$vo[id],'model'=>'core_leave'))}">通过</a>

                            </if>
                            <if condition="$vo.status neq 2">
                            <a class="status status_2 ajax-get" href="{:U('pass',array('method'=>'nopass',id=>$vo[id],'model'=>'core_leave'))}">不通过</a>
                            </if>
                            
                            
                        </td>
                       
                    </tr>
                </volist>
                <else/>
                <td colspan="10" class="text-center">{:L('_ADMIN_USER_EMPTY_')}</td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="with-padding">
        {$page}
    </div>
</block>
